package il.ac.technion;

import java.util.ArrayList;
import java.util.Collection;

public class Table implements IDaoStorable {
	private int size;
	private int id;
	private ArrayList<Guest> guests = new ArrayList<Guest>(size);

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void addGuest(Guest g) {
		guests.add(g);
	}

	public boolean isFull() {
		return size == guests.size();
	}

	public ArrayList<Guest> getGuests() {
		return guests;
	}

	public boolean containsGuests(Collection<Guest> members) {
		ArrayList<Guest> isec = new ArrayList<Guest>(this.guests);
		isec.retainAll(members);
		return !isec.isEmpty();
	}
}
